<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdvertisementsTable extends Migration
{
    /**
     * Run the migrations.
     *
    'title',
    'location',
    'is_title_show',
    'cover',
    'start_time',
    'end_time',
    'jump_link',
    'jump_type',
    'sort',
    'status',
    'silder_text'
     * @return void
     */
    public function up()
    {
        Schema::create('advertisements', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title', 50)->comment('标题');
            $table->string('location', 20)->comment('广告位置');
            $table->boolean('is_title_show')->comment('是否显示标题')->default(true);
            $table->string('cover')->comment('图片');
            $table->dateTime('start_time')->comment('开始时间');
            $table->dateTime('end_time')->comment('结束时间');
            $table->unsignedBigInteger('jump_link')->comment('跳转到的id');
            $table->string('jump_type')->comment('跳转类型')->default(\App\Models\Advertisement::JUPM_TYPE_PRODUCT_VIEW);
            $table->unsignedTinyInteger('sort')->comment('排序')->default(100);
            $table->boolean('status')->comment('状态')->default(true);
            $table->string('silder_text', 150)->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('advertisements');
    }
}
